document.getElementById('registerForm').addEventListener('submit', function(event) {
    var password = document.getElementById('password').value;
    var confirmPassword = document.getElementById('confirm-password').value;
    var errorMessage = document.getElementById('password-error');

    if (password !== confirmPassword) {
        event.preventDefault(); // 阻止表单提交
        errorMessage.style.display = 'block';
    } else {
        errorMessage.style.display = 'none';
    }
});

